<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        const arr = [
            {
                name: '张三',
                salary: 100,
            }
            ,
            {
                name: '李四',
                salary: 100,
            }
            ,
            {
                name: '王老五',
                salary: 100,
            }
        ]
        const total = Object.values(arr).reduce((a, b) => a + b.salary, 0)
        document.write(`工资是${total}`)
    </script>
</body>

</html>